package com.zengdada.authority.utils.data;

import java.util.ArrayList;
import java.util.List;

/**
 * 请求数据类型
 *
 * @author 12614
 * @param <I> 新增数据类型
 * @param <U> 更新数据类型
 * @param <D> 删除数据类型
 */
public class RequestData<I, U, D> {


    public RequestData() {
    }

    public RequestData(final List<I> inserts, List<U> updates, List<D> deletes) {
        this.inserts = inserts;
        this.updates = updates;
        this.deletes = deletes;
    }

    private List<I> inserts;
    private List<U> updates;
    private List<D> deletes;
    private String serverclass;

    public String getServerclass() {
        return serverclass;
    }

    public void setServerclass(String serverclass) {
        this.serverclass = serverclass;
    }

    /**
     * 取新增数据
     *
     * @return
     */
    public List<I> getInserts() {
        return inserts == null ? new ArrayList<>() : inserts;
    }

    public void setInserts(List<I> inserts) {
        this.inserts = inserts;
    }

    /**
     * 取更新数据
     *
     * @return
     */
    public List<U> getUpdates() {
        return updates == null ? new ArrayList<>() : updates;
    }

    public void setUpdates(List<U> updates) {
        this.updates = updates;
    }

    /**
     * 取删除数据
     *
     * @return
     */
    public List<D> getDeletes() {
        return deletes == null ? new ArrayList<>() : deletes;
    }

    public void setDeletes(List<D> deletes) {
        this.deletes = deletes;
    }

}